home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: netcom.com!smryan
- From: smryan@netcom.com (@#$%!?!)
- Subject: Re: Can anyone help a newbie out ?
- Message-ID: <smryanDpqHp2.K3t@netcom.com>
- Organization: The Programmer formerly known as S M Ryan
- X-Newsreader: TIN [version 1.2 PL1]
- References: <4kkf3r$5b0@darwin.nbnet.nb.ca>
- Date: Fri, 12 Apr 1996 05:24:38 GMT
- Sender: smryan@netcom9.netcom.com
-
- : char checksize(char x[], char y[])
- : {
- : int count, int total = 0, int total1 = 0;
-
- : while (*x != NULL)
- : total += 1
-
- : while (*y != NULL)
- : total1 += 1
-
- (1) the variables in the while predicates are loop invariant. The loops
- will either execute zero or infinite number of times.
-
- (2) if you modify x or y, then you must correct the reference to them
- in the following statements.
-
- :
- : if (total < total2)
- : return *y;
- : if (total > total2)
- : return *x;
-
- (3) You are returning a character not a character pointer.
- --
- The Queen, amused, in quiet power, | smryan@netcom.com PO Box 1563
- will draw the son to darkenned bower. | Cupertino, California
- Her face is fair, her fragrance rare, | (xxx)xxx-xxxx 95015
- with woven webs for wayward flower. | I don't use no smileys
-